package edu.stanford.bmir.protege.web.client.ui.ontology.transform;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.layout.BorderLayout;
import com.gwtext.client.widgets.layout.BorderLayoutData;

public class SelectMapping extends Composite {
	
	private VerticalPanel panel = new VerticalPanel();
	
	final Window window = new Window();
	
	String key;
	
	StepTwo stepTwo;
	
	public SelectMapping ( StepTwo two ) {
		initWidget(panel);
		
		this.stepTwo = two;
		
  
	}
	
	public void showWindow () {
		
		SelectTree tree = new SelectTree( this );
		  
        BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);  
        centerData.setMargins(3, 0, 3, 3);
        
        BorderLayoutData sourceData = new BorderLayoutData(RegionPosition.SOUTH);  
        sourceData.setMargins(6, 3, 3, 0); 
        sourceData.setCMargins(6, 3, 3, 3); 
        
        BorderLayoutData westData = new BorderLayoutData(RegionPosition.WEST);  
        westData.setSplit(true);  
        westData.setMargins(3, 3, 0, 3);  
        westData.setCMargins(3, 3, 3, 3);  
  
        
        window.setTitle("");  
        window.setClosable(true);  
        window.setWidth(300);  
        window.setHeight(450);  
        window.setPlain(true);  
        window.setLayout(new BorderLayout());  
        window.add(tree, centerData); 
        window.setCloseAction(Window.HIDE);  
		
		window.show(); 
		
	}
	
	public void closeWindow ( String value ) {
		
		window.close();
		
		//window.clear();
		
		stepTwo.setProperty(value);
		
		
		
	}
	
	

}
